<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a1{
            color: blue;
            text-decoration: underline;
        }
        
    </style>
</head>
<body>
    <button>按钮</button>
    <ul>
        <li>问天</li>
        <li>问月</li>
        <li>问星河</li>
    </ul>
</body>
</html>
<script>
    var but=document.querySelector('button')
    but.onclick=function(){
        var lis=document.querySelectorAll('li')
        for(i=0;i<lis.length;i++){
            lis[i].className='a1'
        }
    }
</script>